Skip to content

feat: Support importing role grants #237

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 6, 2025

Conversation

atorrescogollo
Copy link
Contributor

@atorrescogollo atorrescogollo commented Jun 3, 2025

Resolves #195


Right now, it's not possible to import something like this:

resource "mysql_grant" "example" {
  user = "some_user"
  host = "%"
  roles = [
    "some_role",
  ]
}

That's because imports assume you want to always use a TablePrivilegeGrant.

By adding a new ;r modifier at the end of the import id, the provider will assume you want to import a RoleGrant:

import {
  to = mysql_grant.example
  #id = "some_user@%@*@*"  # <--- As TablePrivilegeGrant
  id = "some_user@%@*@*;r" # <--- As RoleGrant
}

@petoju petoju merged commit e1f8a94 into petoju:master Jun 6, 2025
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot import mysql_grant of role
2 participants